package com.guigu.basedservice.controller;

import com.guigu.basedservice.entity.BaseServCatalog;

import com.guigu.basedservice.service.BaseServCatalogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 总部统一服务目录 前端控制器
 * </p>
 *
 * @author Heyuhang
 * @since 2024-09-26
 */
@CrossOrigin
@RestController
@RequestMapping("/basedservice/base-serv-catalog")
public class BaseServCatalogController {

    @Autowired
    private BaseServCatalogService baseServCatalogService;

    @ApiOperation("获取单个BaseServCatalog数据")
    @RequestMapping("/getOne/{id}")
    public BaseServCatalog getOne(@PathVariable String id){
        return baseServCatalogService.getById(id);
    }

    @ApiOperation("查询所有BaseServCatalog数据")
    @RequestMapping("/list")
    public List<BaseServCatalog> list() {
        List<BaseServCatalog> baseServCatalogList = baseServCatalogService.list(null);
        System.out.println("baseServCatalogList++++"+baseServCatalogList);
        return baseServCatalogList;
    }

    @ApiOperation("查询所有BaseServCatalog数据")
    @RequestMapping("/list2")
    public List<BaseServCatalog> list2() {
        List<BaseServCatalog> baseServCatalogList = baseServCatalogService.list2();
        System.out.println("baseServCatalogList++++"+baseServCatalogList);
        return baseServCatalogList;
    }

    @GetMapping("/catalogs")
    public List<BaseServCatalog> getAllCatalogs() {
        return baseServCatalogService.getAllCatalogs();
    }
}

